package com.netcracker.lab1.view;

import com.netcracker.lab1.controller.MusicTrackController;
import com.netcracker.lab1.model.MusicTrack;
import com.netcracker.lab1.utils.SortComparator;

import javax.swing.*;
import javax.swing.event.ListDataListener;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumnModel;
import javax.swing.table.TableRowSorter;
import java.awt.*;
import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: nocturne
 * Date: 25.01.13
 * Time: 21:05
 * To change this template use File | Settings | File Templates.
 */
public class SwingView extends JFrame {
    private JPanel mainPanel;
    private JTextField textFieldSearch;
    private JButton buttonSearch;
    private JScrollPane scrollPanel;
    private JList playlist;
    private JButton buttonOpen;
    private JButton buttonSave;
    private JTable tablePlayList;
    private JButton buttonCreateTrack;
    private JButton buttonDeleteTrack;
    private JButton buttonConnetDisconnect;
    private JLabel labelStatusConnect;


    public SwingView() {
        createUIComponents();
    }

    private void createUIComponents() {

        setContentPane(mainPanel);
        setTitle("Lab1");
        setSize(920,480);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        setVisible(true);


        TableRowSorter trs = new TableRowSorter(new TableModelPlaylist());
        trs.setComparator(0, new SortComparator());
        tablePlayList.setRowSorter(trs);
        tablePlayList.setAutoCreateRowSorter(false);
        tablePlayList.setModel(new TableModelPlaylist());








    }


}


